<?php


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="/js/Ajax141212.js"></script>
<script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
</head>
<body>


<div style="margin: 0px auto; width: 600px; border: 1px solid #999;">
    <input type="text" id="username" value="18618353136"/>
    <input type="password" id="password" value=""/>
    <input type="button" value="login" onclick="request()"/>
</div>

<script language="javascript">


	
function request(){
	
	var grant_type = "password";
	var username = $('#username').val();
	var password = $('#password').val();
	var client_id = "d813272ec72a5ad7";
	
	new Ajax().post({
		url : "/user/asyncLogin.html",
		data : "grant_type="+grant_type+"&username="+username+"&password="+password+"&client_id="+client_id,
		resultType : "json",
		onLoaded : function(result){
			console.log(result);
			
			if(result.code ==1){
				window.location.href = "/user/index.html";
			}else{
				alert(result.info);
			}
		}
	});
	
	
}



</script>
</body>
</html>